package hu.csicso.ultimatesoftware.parser;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.List;

public class ParserHelper {
	
	public static List<String> getUrlLines(String url)
			throws MalformedURLException, IOException {
		ArrayList<String> pageLines=new ArrayList<String>();
		URL urlO = new URL(url);
		URLConnection urlConn = urlO.openConnection();
		BufferedReader content = new BufferedReader(new InputStreamReader(
				urlConn.getInputStream()));
		boolean eof = false;
		
		//BufferedReader input = new BufferedReader(new InputStreamReader(				System.in));

		while (!eof) {
			String oneLine = content.readLine();
			if (oneLine == null)
				eof = true;
			else
				pageLines.add(oneLine);
				//System.out.println(egysor);
		

		}
		return pageLines;
	}
}
